#ifndef _LOGSIMPL_H_
#define _LOGSIMPL_H_

#include "stdafx.h"

class CLogsImpl :	public ILogs,
					public IPlugin,
					public IPluginRun,
					public CUnknownImp,
					public CSemThread
{
public:
	CLogsImpl(void);
	virtual ~CLogsImpl(void);

public:
	BEGIN_STDCOM_MAP
		STDCOM_INTERFACE_ENTRY_UNKNOWN_(ILogs)
		STDCOM_INTERFACE_ENTRY(IPlugin)
		STDCOM_INTERFACE_ENTRY(IPluginRun)
		STDCOM_INTERFACE_ENTRY(ILogs)
	END_STDCOM_MAP

	//IPlugin
	std_method(Init)(int Argc, basic_tchar* Argv[], IBase* pRot, IBase* pBase);
	std_method(Uninit)();
	
	//IPluginRun
	std_method(Start)(_pinstance hInstance, UINT uType);
	std_method(Stop)(UINT uExitCode);

	//ILogs
	std_method(PostLog)(UCHAR* pBuf, ULONG Size);
	
public:
	std_method(Sem_Thread_Run)();
	std_method(GetRuleFiles)();
	std_method(LoadRuleFiles)();
	std_method(PushFile)(const basic_tchar* file);
	std_method(CreateTaskThread)();
	std_method(UploadTask)();
	std_method(SendSemThread)();
	std_method(ProcessTask)(LogDataPtr cmd);
	std_method(ReadRuleFile)(const basic_tstring& file);
	std_method(SyncTable)(const cJSON* JsRoot);
private:
	ComRotMessagePtr	m_pRot;

	_lComPtr<ILogDataBase>		m_pILogDataBase;
	_lComPtr<ILogFilters>		m_pILogFilters;

private:
	TaskList		m_ListJson;
	CAutoLock		m_lock;
	RuleList		m_RuleFiles;

};

#endif 

